import request from '@/utils/request'

/* 获取岗位列表 */
export function getList(data) {
  return request({
    url: '/apartment/post/list',
    method: 'get',
    params: data
  })
}

/* 新增岗位 */
export function save(data) {
  return request({
    url: '/apartment/post',
    method: 'post',
    data: data
  })
}

/* 编辑岗位 */
export function edit(data) {
  return request({
    url: '/apartment/post',
    method: 'put',
    data: data
  })
}

/* 删除岗位 */
export function remove(id) {
  return request({
    url: `/apartment/post/${id}`,
    method: 'delete'
  })
}

/* 获取岗位详情 */
export function getInfo(id) {
  return request({
    url: `/apartment/post/${id}`,
    method: 'get'
  })
}

export default {
  getList,
  save,
  edit,
  remove,
  getInfo
}